home *** CD-ROM | disk | FTP | other *** search
/ Fritz: All Fritz / All Fritz.zip / All Fritz / FILES / ARTIENCE / XXXPERT.LZH / XXXPERT.DOC < prev    next >
Text File  |  1987-11-06  |  50KB  |  1,813 lines

  1.          
  2.  
  3.          
  4.  
  5.          
  6.  
  7.          
  8.  
  9.          
  10.  
  11.          
  12.  
  13.                                     XXXPERT
  14.  
  15.                                       V11
  16.  
  17.          
  18.  
  19.          
  20.  
  21.          
  22.  
  23.          
  24.  
  25.          
  26.  
  27.          
  28.  
  29.          
  30.  
  31.          
  32.  
  33.          
  34.  
  35.          
  36.  
  37.          
  38.  
  39.          
  40.  
  41.          
  42.  
  43.          
  44.  
  45.                                  Copyright 1987
  46.  
  47.                                 Stephen Thurber
  48.  
  49.                                1926 Labrador Lane
  50.  
  51.                                Vienna, VA  22180
  52.  
  53.                               All rights reserved
  54.  
  55.          
  56.  
  57.          
  58.  
  59.          
  60.  
  61.          INTRODUCTION
  62.  
  63.          
  64.  
  65.          
  66.  
  67.          XXXPERT  is  an  expert  system  development  facility  which 
  68.  
  69.          includes   an   editor,   file  manager  and  expert  systems 
  70.  
  71.          inference   engine   packaged   together  in  one  integrated 
  72.  
  73.          environment.
  74.  
  75.          
  76.  
  77.          You  can use XXXPERT to develop expert systems that use rules 
  78.  
  79.          you  write  in  an  English language syntax.  You can develop 
  80.  
  81.          expert  systems  that will aid you and others in doing things 
  82.  
  83.          that  you  would  not  be  able  to  do  consistently as well 
  84.  
  85.          without   XXXPERT.   XXXPERT  allows  you  to  define  expert 
  86.  
  87.          knowledge  just once then apply it repeatedly time after time 
  88.  
  89.          as  a  stand-alone  expert  system  or  integrated with other 
  90.  
  91.          applications  software and other files.  There is essentially 
  92.  
  93.          no  limit  to  the size and complexity of expert systems that 
  94.  
  95.          may  be  constructed  with XXXPERT.  XXXPERT is very fast and 
  96.  
  97.          allows  rulebases  (expertise) to be chained together into an 
  98.  
  99.          arbitrarily large system of knowledge.
  100.  
  101.          
  102.  
  103.          XXXPERT   is   a   product  that  is  distributed  under  the 
  104.  
  105.          'shareware'   concept.   Please  see  the  next  chapter  for 
  106.  
  107.          further explanation.
  108.  
  109.          
  110.  
  111.          
  112.  
  113.          
  114.  
  115.          SHAREWARE
  116.  
  117.          
  118.  
  119.          
  120.  
  121.          XXXPERT  is  distributed  under  a  concept commonly known as 
  122.  
  123.          'shareware'.   This  approach to software distribution allows 
  124.  
  125.          you  to receive and try software then pay for it according to 
  126.  
  127.          the value you have received from it.
  128.  
  129.          
  130.  
  131.          If  you  feel  that,  after  trying XXXPERT, it has given you 
  132.  
  133.          some  value,  please  contribute according to your conscience 
  134.  
  135.          and  level  of  satisfaction.   Shareware operates largely on 
  136.  
  137.          the  honor  system  with  a  contribution being your vote for 
  138.  
  139.          continued  development  of  this  product.  If you contribute 
  140.  
  141.          $49.00  or  more,  you  will  receive  a  copy of the current 
  142.  
  143.          updated  versions  of XXXPERT and CONSULT, as well as a USER-
  144.  
  145.          ID  that entitles you to future releases for a modest renewal 
  146.  
  147.          royalty  (currently  $5.00 per release) and, in addition, you 
  148.  
  149.          will  receive  a $10.00 rebate each time someone else makes a 
  150.  
  151.          $49.00  or  larger  royalty  contribution from a copy of your 
  152.  
  153.          own  paid  copy  of  XXXPERT  using the Form provided on your 
  154.  
  155.          paid  updated  disk.   (Rebates  are limited to the amount of 
  156.  
  157.          your contribution.)
  158.  
  159.          
  160.  
  161.          
  162.  
  163.          Continued  commercial, non-profit and government organization 
  164.  
  165.          use  is  prohibited unless a $49.00 royalty has been paid for 
  166.  
  167.          each  copy  of  XXXPERT  in  use (ie: according to the common 
  168.  
  169.          analogy  with  books--one  reader/user  at  a time per copy). 
  170.  
  171.          Site  licenses  are  available  for  a  royalty  of $2000.00, 
  172.  
  173.          however, for large users.
  174.  
  175.          
  176.  
  177.          Please address correspondence and contributions to:
  178.  
  179.          
  180.  
  181.                                   XXXPERT,V11 
  182.  
  183.                               c/o Stephen Thurber
  184.  
  185.                               1926 Labrador Lane 
  186.  
  187.                               Vienna, VA  22180  
  188.  
  189.          
  190.  
  191.          
  192.  
  193.          
  194.  
  195.          
  196.  
  197.          XXXPERT DESIGN PHILOSOPHY
  198.  
  199.          
  200.  
  201.          
  202.  
  203.          A  few  words on the design philosopy underlying XXXPERT will 
  204.  
  205.          probably  aid  you gretly in using it well.  Therefore I will 
  206.  
  207.          digress  a  bit  before  returning  you  to  a nuts and bolts 
  208.  
  209.          discussion  of  product  features.  The following are the key 
  210.  
  211.          points  of  XXXPERT's general design approach and the reasons 
  212.  
  213.          for each:
  214.  
  215.          
  216.  
  217.          1.  XXXPERT  and  CONSULT  are conceived to be complements to 
  218.  
  219.          your  existing  stable  of  software.   Therefore the product 
  220.  
  221.          concentrates  on  delivering  only  those  features which are 
  222.  
  223.          uniquely  an  aspect  of expert systems while providing links 
  224.  
  225.          and  tools  to  make  the  product cooperate with the rest of 
  226.  
  227.          your  PC  software.   This  is  helpful  since  you  probably 
  228.  
  229.          already   know  how  to  use  an  existing  set  of  software 
  230.  
  231.          (including  DOS,  batch  files,  a  database,  spreadsheet or 
  232.  
  233.          whatever)  and  would  like to spend a minimum amount of time 
  234.  
  235.          on   learning   new  quirks  of  other  software.   It  would 
  236.  
  237.          therefore  be  wasteful  of your time (and mine) to duplicate 
  238.  
  239.          commonly  available  software functions here in this product.  
  240.  
  241.          For   this   reason,  you  will  not  find  a  new  database, 
  242.  
  243.          spreadsheet,  or  batch file syntax introduced here.  Instead 
  244.  
  245.          XXXPERT  adds  only  the new features you need to quickly add 
  246.  
  247.          expert  systems  capabilities to your overall PC applications 
  248.  
  249.          environment.   You  will  not  need  to  learn new syntax for 
  250.  
  251.          features duplicating those you already have on your PC.
  252.  
  253.          
  254.  
  255.          2.   There is a wide variety of other software out there, and 
  256.  
  257.          any  of  it may interest you as a complement to this product.  
  258.  
  259.          XXXPERT  and  CONSULT therefore are designed to link to other 
  260.  
  261.          software  through  standard DOS files,  DBASE 3 (r) files and 
  262.  
  263.          LOTUS  (r)  .WKS  spreadsheet files, allowing you to use them 
  264.  
  265.          with virtually any other PC software.
  266.  
  267.          
  268.  
  269.          3.   You probably already know how to use DOS batch files, so 
  270.  
  271.          this  product  does  not  introduce another 'script' language 
  272.  
  273.          for  you  to  use.   Instead,  we  attempt to make it easy to 
  274.  
  275.          build  systems  using DOS batch files to script together your 
  276.  
  277.          application  with  this product and any other type of product 
  278.  
  279.          (or  user-written program) of your chosing.  This approach is 
  280.  
  281.          easy, familiar and frugal with PC memory.
  282.  
  283.          
  284.  
  285.          4.   This product has an integrated development approach that 
  286.  
  287.          is  similar  to popular new programming language compilers in 
  288.  
  289.          that  coding,  compilation, testing, debugging, and operating  
  290.  
  291.          expert  systems  may  be  done without leaving XXXPERT.  This 
  292.  
  293.          greatly  speeds  the  development process for expert systems.  
  294.  
  295.          A  CONSULT  "run-time"  system  lets you build expert systems 
  296.  
  297.          technology   into   your  applications  (with  XXXPERT  being 
  298.  
  299.          essentially  invisible  to  the  user.)   A  MINICON run time 
  300.  
  301.          system is included for situations wherein memory is tight.
  302.  
  303.          
  304.  
  305.          
  306.  
  307.          
  308.  
  309.          HARDWARE REQUIREMENTS
  310.  
  311.          
  312.  
  313.          
  314.  
  315.          XXXPERT  requires  an  IBM (r) or closely compatible computer 
  316.  
  317.          with  DOS 2.1 or above, 256k RAM or more, and a monochrome or 
  318.  
  319.          color  monitor.  Additional RAM may be needed to use the RUN@ 
  320.  
  321.          feature  that allows you to run other programs within XXXPERT 
  322.  
  323.          and  CONSULT (depending on the size of the program you intend 
  324.  
  325.          to run.)  MINICON can run in as little as 115k, however.
  326.  
  327.          
  328.  
  329.          THE XXXPERT DISK
  330.  
  331.          
  332.  
  333.          
  334.  
  335.          Please  feel  free to make as many copies of the XXXPERT disk 
  336.  
  337.          as  you  wish, PROVIDED THAT ALL OF THE FILES ON THE DISK ARE 
  338.  
  339.          COPIED  WITHOUT  MODIFICATION.   You  may  give copies of the 
  340.  
  341.          disk  to  anyone,  and are encouraged to do so as long as you 
  342.  
  343.          do  not  distribute  any  XXXPERT  file  without  the others.  
  344.  
  345.          XXXPERT files include:
  346.  
  347.          
  348.  
  349.          XXXPERT.COM                    the integrated expert system
  350.  
  351.          CONSULT.COM                    the consult-only system     
  352.  
  353.          XXXPERT.DOC                    this document               
  354.  
  355.          XXXPERT.FRM                    a correspondence form       
  356.  
  357.          CAR.R                          car diagnosis rules sample  
  358.  
  359.          CAR.K                          compiled car rules          
  360.  
  361.          CAR.A                          car diagnosis asks sample   
  362.  
  363.          CAR2.R                         another car rules sample    
  364.  
  365.          CAR2.K                         compiled car2 rules         
  366.  
  367.          CAR2.A                         another car asks sample     
  368.  
  369.          CREDIT.R                       credit authorization rules  
  370.  
  371.          CREDIT.K                       compiled credit rules       
  372.  
  373.          CREDIT.A                       credit authorization asks   
  374.  
  375.          CHEESE.R                       cheese selection rules      
  376.  
  377.          CHEESE.K                       compiled cheese rules       
  378.  
  379.          CHEESE.A                       cheese selection asks       
  380.  
  381.          READ.ME                        introductory notes
  382.  
  383.          
  384.  
  385.          
  386.  
  387.          
  388.  
  389.          INSTALLING XXXPERT
  390.  
  391.          
  392.  
  393.          XXXPERT  should  be installed on a diskette along with a copy 
  394.  
  395.          of your DOS system.  The easiest way to do this is:
  396.  
  397.          
  398.  
  399.          1: Insert your DOS diskette in drive A.
  400.  
  401.          2: Insure that A is the default drive.
  402.  
  403.          3: Insert a new floppy disk in drive B.
  404.  
  405.          4: type: format b:/s
  406.  
  407.          5: press return.
  408.  
  409.          6: Insert the XXXPERT distribution disk in drive A.
  410.  
  411.          7: type: copy a:*.*  b:
  412.  
  413.          8: press return.
  414.  
  415.          
  416.  
  417.          The  new disk will then be ready to use as your expert system 
  418.  
  419.          disk.
  420.  
  421.          
  422.  
  423.          Alternatively, XXXPERT may be installed on your hard disk.  
  424.  
  425.          
  426.  
  427.          
  428.  
  429.          
  430.  
  431.          DEVELOPING RULES
  432.  
  433.          
  434.  
  435.          XXXPERT   is   a   rule-driven   system.   Rules  are  simply 
  436.  
  437.          statements  of  logic  that  you  wish to have applied to the 
  438.  
  439.          area   of   expertise  your  rules  are  to  address.   These 
  440.  
  441.          statements   are   written   in  English   and  abbreviations 
  442.  
  443.          thereof.   The  first  rule statement in a rules file must be 
  444.  
  445.          on  a  line  by  itself  (and on the first line of the file).  
  446.  
  447.          This  statement  must  specify  the  name of the goal for the 
  448.  
  449.          consultations  to  be  performed with the set of accompanying  
  450.  
  451.          rules.   In  the  CAR  rulebase the goal is PROBLEM since the 
  452.  
  453.          purpose  of  the CAR consultation is to determine the probelm 
  454.  
  455.          with  the  car.   The  goal  in  a  rule  file  is  always an 
  456.  
  457.          identifier  (a  fieldname  or variable) to name the object of 
  458.  
  459.          the   consultation   process.    XXXPERT  will  use  all  the 
  460.  
  461.          subsequent  rule  statements  to  seek  a value for the goal.   
  462.  
  463.          Each  rule statement after the first must be of the following 
  464.  
  465.          general form:
  466.  
  467.          
  468.  
  469.          IF ==== EQ ---- AND ==== EQ ---- THEN ==== EQ ----
  470.  
  471.          
  472.  
  473.          
  474.  
  475.          where  ==== indicates an identifier (a fieldname or variable) 
  476.  
  477.          and  ----  indicates  a  state  (a  constant  or value).  For 
  478.  
  479.          example,  to  express  the  knowledge  that:   baby's  diaper 
  480.  
  481.          should  be changed when baby is crying and diaper is wet, the 
  482.  
  483.          rule could be coded:
  484.  
  485.          
  486.  
  487.          IF   DIAPER  EQ  WET  AND  BABYACT  EQ  CRY  THEN  ACTION  EQ 
  488.  
  489.          NEW.DIAPER
  490.  
  491.          
  492.  
  493.          The  EQ  in  XXXPERT's  rules  syntax stands for equals.  The 
  494.  
  495.          keyword  NE may be used to express an inequality (not equals) 
  496.  
  497.          situation  in  otherwise  similar  syntax.   For field values 
  498.  
  499.          that  are numeric, the GT (greater than), GE (greater than or 
  500.  
  501.          equal  to),  LT  (less  than), and LE (less than or equal to) 
  502.  
  503.          keywords  may  also  be used as appropriate.  The part of the 
  504.  
  505.          rules  statement  format  shown above as: AND ==== EQ ---- is 
  506.  
  507.          optional  as  well  as  repeatable.   Thus the following rule 
  508.  
  509.          examples  are  all  valid  and  meaningful (but different, of 
  510.  
  511.          course!):
  512.  
  513.          
  514.  
  515.          IF DIAPER EQ WET THEN ACTION EQ NEW.DIAPER
  516.  
  517.          
  518.  
  519.          IF  DIAPER  EQ  WET  AND BABYACT EQ CRY AND HAD.NO.NAP EQ YES 
  520.  
  521.          THEN ACTION EQ GETHELP
  522.  
  523.          
  524.  
  525.          
  526.  
  527.          A  set  of  rules may be constructed in this way to handle an 
  528.  
  529.          arbitrarily   complex  set  of  expertise.   The  CAR.R  file 
  530.  
  531.          contains   an   example   set  of  rules  for  diagnosing  an 
  532.  
  533.          automobile  that  won't start.  The CHEESE.R file contains an 
  534.  
  535.          example  set of rules for choosing cheese to go with a course 
  536.  
  537.          of  a  meal.   Other  examples may be found in the CAR2.R and 
  538.  
  539.          CREDIT.R  files.   You may use the DOS 'type' command to view 
  540.  
  541.          these  files  or  you  may use the XXXPERT rules editor after 
  542.  
  543.          doing   a   Getfile   for   CAR,   CHEESE,   CAR2  or  CREDIT 
  544.  
  545.          respectively.
  546.  
  547.          
  548.  
  549.          Identifiers  (fields  or  variables) may be any name or other 
  550.  
  551.          collection  of  letters,  punctuation and numbers in a string 
  552.  
  553.          up  to  16  characters  in  length.   Imbedded blanks are not 
  554.  
  555.          allowed.   Constants  (values)  are  subject  to  these  same 
  556.  
  557.          restrictions.   Constants  may  be  words  or  numbers and if 
  558.  
  559.          numeric  they may be integer (ie: 1) or real (ie: 123.45).  A 
  560.  
  561.          single  file  of rules may consist of up to 400 rule elements 
  562.  
  563.          in  this version of XXXPERT.  A rule element is generated  by 
  564.  
  565.          each  IF  and by each pair of ANDs.  Rulebases with more than 
  566.  
  567.          400  rule  elements  can  be  effectively implemented through 
  568.  
  569.          multiple  related  rulebases.   Techniques for achieving this 
  570.  
  571.          are  discussed  in the section on EPLIOGUE and in the section 
  572.  
  573.          on extended input/output.
  574.  
  575.          
  576.  
  577.          
  578.  
  579.          Rules  are  coded in free format with multiple rules per line 
  580.  
  581.          or  multi-line  rules  as  desired.  XXXPERT supports sets of 
  582.  
  583.          rules  up  to  300 lines per file in this version of XXXPERT.  
  584.  
  585.          This  limit  is  also  easily  circumvented  through multiple 
  586.  
  587.          related  rulebase techniques.  NOTE: Rules must be created in 
  588.  
  589.          upper  case,  and this requirement is enforced by the XXXPERT 
  590.  
  591.          editor.   (The  editor uses upper case regardless of the case 
  592.  
  593.          you type.)
  594.  
  595.          
  596.  
  597.          
  598.  
  599.          
  600.  
  601.          DEVELOPING ASKS
  602.  
  603.          
  604.  
  605.          XXXPERT  will  need  certain information from the user in the 
  606.  
  607.          course  of  any  given  consultation session depending on the 
  608.  
  609.          rules  being  used  in  that  session.  The "asks" define how 
  610.  
  611.          XXXPERT   should   ask   the   user   (consultee)   for  such 
  612.  
  613.          information.   In  general  you  should  code an ask for each 
  614.  
  615.          identifier  that  appears  in  the  left-hand-side  of a rule 
  616.  
  617.          (before  the  THEN) unless it also appears in the right-hand-
  618.  
  619.          side of another rule.
  620.  
  621.          
  622.  
  623.          XXXPERT  asks  consist  of two lines each.  The first line of 
  624.  
  625.          each  ask  must  contain  the identifier to which it applies, 
  626.  
  627.          and  the  identifier must begin at the beginning of the line.  
  628.  
  629.          The  second  line  of  each  ask  must  contain  one  of  the 
  630.  
  631.          following:  1)  A  text  prompt  that  XXXPERT  should use to 
  632.  
  633.          request  a  value  from the user for that identifier; or 2) A 
  634.  
  635.          specification  for  a  worksheet  cell from which to retrieve 
  636.  
  637.          the  information;  3) A specification of a database .DBF file 
  638.  
  639.          and  record selection specification for a record containing a 
  640.  
  641.          value  for  the  ask;  or 4) A specification for a program to 
  642.  
  643.          run  which will provide the necessary data to XXXPERT.  Thus, 
  644.  
  645.          odd-numbered  lines  of  the asks (first, third, fifth, etc.) 
  646.  
  647.          will  contain  identifiers  while  even-numbered  lines  will 
  648.  
  649.          contain  the associated text prompt for the user, a worksheet 
  650.  
  651.          
  652.  
  653.          specification,   a   database   specification  or  a  program 
  654.  
  655.          specification.
  656.  
  657.          
  658.  
  659.          To  define a text prompt for an ASK you merely place the text 
  660.  
  661.          of  the  desired  prompt  on  the  second  line  of  the ASK.  
  662.  
  663.          XXXPERT  and  CONSULT will automatically edit a user response 
  664.  
  665.          to  the prompt to insure that the response in consistent with 
  666.  
  667.          at  least  one rule in the rulebase being used.  In the event 
  668.  
  669.          that  the response is invalid there will be a warning message 
  670.  
  671.          and the prompt will be repeated for the user.
  672.  
  673.          
  674.  
  675.          To  define  a  worksheet  reference  you begin the second ASK 
  676.  
  677.          line  with  the  keyword:  WKS@  followed  by the name of the 
  678.  
  679.          worksheet  followed by the desired cell.  To refer to the C25 
  680.  
  681.          cell  of  a  worksheet  named  BUDGET.WKS  for  an ASK of the 
  682.  
  683.          XXXPERT  field  named  SALES  you  would  use  the  following 
  684.  
  685.          statements:
  686.  
  687.          
  688.  
  689.          SALES
  690.  
  691.          WKS@ BUDGET C25
  692.  
  693.          
  694.  
  695.          Only  standard  .WKS  format  files  are  supported  by  this 
  696.  
  697.          feature.   If  the  attempt to retrieve worksheet data should 
  698.  
  699.          fail,   a  value  of  NA  will  be  returned  for  the  field 
  700.  
  701.          associated  with the ASK.  NA should therefore not be used as 
  702.  
  703.          a value in RULES.
  704.  
  705.          
  706.  
  707.          
  708.  
  709.          To  define  a database reference you begin the second line of 
  710.  
  711.          the  ASK with the keyword: DB3@ followed by the database file 
  712.  
  713.          name  followed  by  a  selector  field followed by a value to 
  714.  
  715.          search  for  in  the  selector field.  The DB3 interface will 
  716.  
  717.          look  for  a  record  which  has  the  stated  value  in  the 
  718.  
  719.          specified  selector  field.   Upon finding such a record, the 
  720.  
  721.          value  in  that record for the ASKed field in the record will 
  722.  
  723.          be  given  to  the  ASKed  field in XXXPERT.  To refer to the 
  724.  
  725.          record  containing 1987 in the YEAR field of a database named 
  726.  
  727.          BUDGET.DBF  for  an  ASK of the XXXPERT field named SALES you 
  728.  
  729.          would use the following statements:
  730.  
  731.          
  732.  
  733.          SALES
  734.  
  735.          DB3@ BUDGET YEAR 1987
  736.  
  737.          
  738.  
  739.          Only  standard .DBF format dBASE 3 (r) files are supported by 
  740.  
  741.          this  feature.   If  the attempt to retrieve  database record 
  742.  
  743.          should  fail,  a  value  of NA will be returned for the field 
  744.  
  745.          associated  with the ASK.  NA should therefore not be used as 
  746.  
  747.          a value in RULES.
  748.  
  749.          
  750.  
  751.          To  define  a  program  to  run  under  XXPERRT or CONSULT to 
  752.  
  753.          provide  the data needed for an ASK you must begin the second 
  754.  
  755.          line  of  the ASK with the code: RUN@ followed by the name of 
  756.  
  757.          the  program  to be run.  To run GETDAT.COM you would use the 
  758.  
  759.          following statement on the second line of the ASK:
  760.  
  761.          
  762.  
  763.          
  764.  
  765.          RUN@ GETDAT
  766.  
  767.          
  768.  
  769.          The  program that you run must be a .COM format file and must 
  770.  
  771.          not  require  more  memory  than  is  left  available on your 
  772.  
  773.          machine  after  XXXPERT  or  CONSULT has been loaded in.  The 
  774.  
  775.          program  that  you run must place a value for the AKSed field 
  776.  
  777.          in  a  file  named  RUN.I  (this is where XXXPERT and CONSULT 
  778.  
  779.          will  be looking for it).  The program that you run must also 
  780.  
  781.          be  well-mannered  enough  to  not  disturb  DOS,  CONSULT or 
  782.  
  783.          XXXPERT-owned  parts  of  your  computer.  If your program is 
  784.  
  785.          too  large  or  ill-mannered  your consultation will crash or 
  786.  
  787.          behave   unpredictably.   If  the  attempt  to  retrieve  the 
  788.  
  789.          program's  data  should  fail, a value of NA will be returned 
  790.  
  791.          for  the  field associated with the ASK.  NA should therefore 
  792.  
  793.          not be used as a value in RULES.
  794.  
  795.          
  796.  
  797.          XXXPERT  supports  sets  of asks of up to 600 lines per file.  
  798.  
  799.          Once  you  create  a set of asks you should save it under the 
  800.  
  801.          same  name  as  the  rules  that you intend to use them with.  
  802.  
  803.          See  CHEESE.A,  CREDIT.A, CAR.A and CAR2.A for asks examples.  
  804.  
  805.          NOTE:   Asks   must  be  created  in  upper  case,  and  this 
  806.  
  807.          requirement is enforced by the XXXPERT editor.
  808.  
  809.          
  810.  
  811.          
  812.  
  813.          
  814.  
  815.          PROLOGUE, INTERMISSION AND EPILOG
  816.  
  817.          
  818.  
  819.          It  may  be  desirable for certain explanatory information to 
  820.  
  821.          be  displayed  in the course of a consultation in the XXXPERT 
  822.  
  823.          environment.   The prologue feature, intermission feature and 
  824.  
  825.          epilogue   feature  are  all  provided  in  XXXPERT  to  this 
  826.  
  827.          purpose.   Prologue  provides  the ability to define a screen 
  828.  
  829.          of  text  to  be displayed at the beginning of a consultation 
  830.  
  831.          with  a  given  set  of  rules.   Intermission  provides  the 
  832.  
  833.          ability  to  define  a  screen  of  text for any given set of 
  834.  
  835.          rules  that  is  to be displayed at the end of a consultation 
  836.  
  837.          but   just   prior   to   the  presentation  of  the  XXXPERT 
  838.  
  839.          conclusion.   Epilogue  provides  the  ability  to  define  a 
  840.  
  841.          screen  of  text  for  any  given  set of rules that is to be 
  842.  
  843.          displayed  after  the  presentation of the XXXPERT conclusion 
  844.  
  845.          and  that  may vary depending on the specific conclusion that 
  846.  
  847.          is reached by XXXPERT.
  848.  
  849.          
  850.  
  851.          You  may  use the prologue feature by entering the editor (as 
  852.  
  853.          described  in  the  next chapter) to create a prologue screen 
  854.  
  855.          under  the  same  file name as the rules you intend to use it 
  856.  
  857.          with.   The  screen  contents may be entirely of your chosing 
  858.  
  859.          up  to the 20 line limit provided for the prologue screen for 
  860.  
  861.          any given file group (set of rules files.)
  862.  
  863.          
  864.  
  865.          
  866.  
  867.          You  may  use the intermis feature by entering the editor (as 
  868.  
  869.          described  in  the  next chapter) to create a intermis screen 
  870.  
  871.          under  the  same  file name as the rules you intend to use it 
  872.  
  873.          with.   The  screen  contents may be entirely of your chosing 
  874.  
  875.          up  to the 20 line limit provided for the intermis screen for 
  876.  
  877.          any given file group (set of rules files.)
  878.  
  879.          
  880.  
  881.          You  may  use the epilogue feature by entering the editor (as 
  882.  
  883.          described  in  the next chapter) to create an epilogue screen 
  884.  
  885.          for  each conclusion (value for the rules goal) that you want 
  886.  
  887.          to  have in your rules file.  The format of the epilogue file 
  888.  
  889.          is  similar to that for asks in the sense that you must put a 
  890.  
  891.          value  on  a line by itself (at the beginning of the line) to 
  892.  
  893.          identify  the  start  of  the  text  associated  with a given 
  894.  
  895.          possible  conclusion  (goal value).  The text to be displayed 
  896.  
  897.          when  that  goal  value is selected as the XXXPERT conslusion 
  898.  
  899.          must  be  coded on the immediately subsequent lines (up to 20 
  900.  
  901.          lines).   The  end  of  the text associated with a given goal 
  902.  
  903.          value  (conclusion)  is  delimited  by  placing the same goal 
  904.  
  905.          value  on  a line by itself at the beginning of the line.  An 
  906.  
  907.          epilogue  file  for  2  possible goal values (a conclusion of 
  908.  
  909.          YES and a conclusion of NO) might look like this:
  910.  
  911.          
  912.  
  913.          (see next page)
  914.  
  915.          
  916.  
  917.          
  918.  
  919.          YES
  920.  
  921.          THIS IS THE TEXT I WANT TO DISPLAY FOR THE YES CONCLUSION
  922.  
  923.          FOR MY EPILOGUE
  924.  
  925.          YES
  926.  
  927.          NO
  928.  
  929.          THIS IS THE TEXT I WANT TO DISPLAY FOR THE NO CONCLUSION
  930.  
  931.          FOR MY EPILOGUE
  932.  
  933.          NO
  934.  
  935.          
  936.  
  937.          The  EPILOGUE facility also allows you to link to another set 
  938.  
  939.          of   rules   depending   on   the   results  of  the  current 
  940.  
  941.          consultation.   This  feature  (called chaining) is available 
  942.  
  943.          only  in  the  CONSULT  program  (see  the chapter on CONSULT 
  944.  
  945.          later  in  this  manual)  and  it  allows the construction of 
  946.  
  947.          expert systems with essentially any number of rules.
  948.  
  949.          
  950.  
  951.          Chaining  is  the  capability  to  link  multiple  rule files 
  952.  
  953.          serially  within  a single CONSULTation run.  This capability 
  954.  
  955.          is  implemented  through  the  CHN@  command  in the EPILOGUE 
  956.  
  957.          facility.   CHN@  allows you to name a rulebase to invoke and 
  958.  
  959.          causes  the  results of the current consultation to be passed 
  960.  
  961.          on  to the consultation for the named rulebase.  The EPILOGUE 
  962.  
  963.          facility    allows    for   an   individual   CHN@   rulebase 
  964.  
  965.          specification   for   each   possible   consultation  result, 
  966.  
  967.          therefore  the rulebase used for the next consultation may be 
  968.  
  969.          varied    according   to   the   outcome   of   the   current 
  970.  
  971.          consultation.   There  is  no  limit  to the number of levels 
  972.  
  973.          rulebases that may be involved in this type of arrangement.
  974.  
  975.          
  976.  
  977.          To  specify a set of rules to be chained-to after the current 
  978.  
  979.          consultation  is  completed you include a CHN@ keyword as the 
  980.  
  981.          first  4  characters  in  any  of  the epilogue lines for the 
  982.  
  983.          value  of  the  goal  to  which  chaining  is to apply in the 
  984.  
  985.          chained-from   consultation.    CONSULT  will  recognize  the 
  986.  
  987.          keyword,  suppress  display  of that epilogue line and use it 
  988.  
  989.          as   a  specification  for  chaining.   The  CHN@  should  be 
  990.  
  991.          followed  by  at  least one space, then the name of the rules 
  992.  
  993.          file  to  use  for  the  next  stage  of  consultation.   For 
  994.  
  995.          example,  to  chain  to  the XYZ rules when the value for the 
  996.  
  997.          current  consultation  goal  is ABC an EPILOGUE with no other 
  998.  
  999.          display lines would look like this:
  1000.  
  1001.          
  1002.  
  1003.          ABC
  1004.  
  1005.          CHN@ XYZ
  1006.  
  1007.          ABC
  1008.  
  1009.          
  1010.  
  1011.          Other  lines  of  information could have been included in the 
  1012.  
  1013.          EPILOGUE  and  would  have  been displayed normally.  If more 
  1014.  
  1015.          than  one CHN@ line is included in the range of lines for one 
  1016.  
  1017.          value  of  the  goal then the last CHN@ line so included will 
  1018.  
  1019.          prevail.
  1020.  
  1021.          
  1022.  
  1023.          
  1024.  
  1025.          The  use  of  CHN@ overrides the usual convention on .O files 
  1026.  
  1027.          inn   the  CONSULT  program  (see  the  section  on  extended 
  1028.  
  1029.          input/output  later  in  this  manual).  Instead of observing 
  1030.  
  1031.          the  .O  file convention, a .I file is created under the name 
  1032.  
  1033.          of  the  chained-to  rules  (ie: XYZ.I in the example above).  
  1034.  
  1035.          This  file  contains the name and value of the goal field for 
  1036.  
  1037.          the  chained-from  rules  so that the chained-to consultation 
  1038.  
  1039.          rules  may  be primed with data from the goal of the chained-
  1040.  
  1041.          from  rules.   Using this feature you can create a network of 
  1042.  
  1043.          sets  of  rules that comprise a knowledge-base that may be as 
  1044.  
  1045.          large as one wishes.
  1046.  
  1047.          
  1048.  
  1049.          
  1050.  
  1051.          
  1052.  
  1053.          USING XXXPERT
  1054.  
  1055.          
  1056.  
  1057.          You  may  start  XXXPERT  by  booting  your  system  with the 
  1058.  
  1059.          XXXPERT  disk  in  the  default drive A.  When the system has 
  1060.  
  1061.          completed the boot process XXXPERT may be started by typing:
  1062.  
  1063.          
  1064.  
  1065.          xxxpert
  1066.  
  1067.          
  1068.  
  1069.          and  pressing  the  return  key.   XXXPERT  will  start and a 
  1070.  
  1071.          banner  screen  will  appear  welcoming  you  to  the XXXPERT 
  1072.  
  1073.          system  environment.   To  continue  you  should press return 
  1074.  
  1075.          once again.
  1076.  
  1077.          
  1078.  
  1079.          At  this point XXXPERT's main menu will display, offering the 
  1080.  
  1081.          following options:
  1082.  
  1083.          
  1084.  
  1085.          Getfile  Editfile  Consult  Keep  Trace  Xref  Output  Quit
  1086.  
  1087.          
  1088.  
  1089.          You  may  select  the  option  you  need  by typing the first 
  1090.  
  1091.          letter  of  the  name of the option.  The letter may be typed 
  1092.  
  1093.          in  either  upper  or lower case.  Alternatively, you may use 
  1094.  
  1095.          the   right-arrow   and   left-arrow  keys  to  position  the 
  1096.  
  1097.          highlight  box  over  a  menu  selection  and press return to 
  1098.  
  1099.          activate  that  selection.   These are conventions that apply 
  1100.  
  1101.          to   all  menu  selection  options  throughtout  the  XXXPERT 
  1102.  
  1103.          product.
  1104.  
  1105.          
  1106.  
  1107.          
  1108.  
  1109.          
  1110.  
  1111.          
  1112.  
  1113.          GETFILE
  1114.  
  1115.          
  1116.  
  1117.          The  main  menu's  Getfile  option  brings  up a prompt for a 
  1118.  
  1119.          filename  and  loads the file group you specify into the file 
  1120.  
  1121.          areas  within  XXXPERT.    This  allows  you  to  retrieve  a 
  1122.  
  1123.          previously-created  set  of  inference  rules, asks and other 
  1124.  
  1125.          information  so  that  you  may  modify  and/or  consult with 
  1126.  
  1127.          them.   If  you  make  a error in typing the filename you may 
  1128.  
  1129.          use  the  backspace  (or left-arrow) key to correct it.  Once 
  1130.  
  1131.          the  file name has been typed press the return key to perform 
  1132.  
  1133.          the  get.   Do not include an extension in the file name (ie: 
  1134.  
  1135.          to  retrieve  the  sample car rules and asks, CAR is correct, 
  1136.  
  1137.          CAR.R  is  incorrect.)   XXXPERT  will retrive both the rules 
  1138.  
  1139.          and    all   related   files   (including   asks,   prologue, 
  1140.  
  1141.          intermission  and  epilog,  if  present)  for  the  specified 
  1142.  
  1143.          name.   In  the CAR example above, both CAR.R and CAR.A would 
  1144.  
  1145.          be reteived by requesting CAR.
  1146.  
  1147.          
  1148.  
  1149.          
  1150.  
  1151.          
  1152.  
  1153.          EDITFILE
  1154.  
  1155.          
  1156.  
  1157.          The  main  menu's  Editfile  option brings up a menu of these 
  1158.  
  1159.          suboptions:
  1160.  
  1161.          
  1162.  
  1163.          Rules    Asks   Prologue   Intermis   Epilogue    Quit
  1164.  
  1165.          
  1166.  
  1167.          The  rules  option  starts  the  rules  editor  subsystem and 
  1168.  
  1169.          displays  the  first  screen  of  rules from the current file 
  1170.  
  1171.          group.   If  the  current  filegroup's set of rules is empty, 
  1172.  
  1173.          the  edit  screen  will  be  blank  (this will be the case if 
  1174.  
  1175.          Getfile  has  not been successfully performed and no previous 
  1176.  
  1177.          rules  edit  has  been  performed since XXXPERT was started.)  
  1178.  
  1179.          Once  in  the  rules  editor you may type in XXXPERT rules in 
  1180.  
  1181.          free  format.   The  editor always stores rule information in 
  1182.  
  1183.          upper  case except for numbers and punctuation which (for the 
  1184.  
  1185.          ones  that  are  allowed)  are  stored  in  the  way they are 
  1186.  
  1187.          typed.   The  home,  up-arrow,  left-arrow, right-arrow, end, 
  1188.  
  1189.          down-arrow,  pagedown,  and  pageup  keys may be used to move 
  1190.  
  1191.          the  cursor position accordingly.  The backspace key performs 
  1192.  
  1193.          the  same  function  as  the  left-arrow.  The del key may be 
  1194.  
  1195.          used  to  delete  characters  and  the ins key may be used to 
  1196.  
  1197.          switch  to and from insert mode in the editor.  (An indicator 
  1198.  
  1199.          in  the  bottom  line  of  the  edit screen notes whether the 
  1200.  
  1201.          editor  is  in  insert mode or overtype mode.)  A line may be 
  1202.  
  1203.          deleted  by  pressing  the  D key while the ctrl key is being 
  1204.  
  1205.          held  down.   The  return  key will advance the cursor to the 
  1206.  
  1207.          start  of  the next line on the screen except while in insert 
  1208.  
  1209.          mode,  in  which case the return key will insert a blank line 
  1210.  
  1211.          in  front  of  the  line  in  which  the  cursor is currently 
  1212.  
  1213.          positioned.    The  slash  key  (/) may be used to bring in a 
  1214.  
  1215.          pop-up  menu  for  other functions as described in the EDITOR 
  1216.  
  1217.          POP-UP MENU section below.
  1218.  
  1219.          
  1220.  
  1221.          The   asks  option  starts  the  asks  editor  subsystem  and 
  1222.  
  1223.          displays  the  first  screenful of asks from the current file 
  1224.  
  1225.          group  in  XXXPERT.  Asks edit performs functions in the same 
  1226.  
  1227.          manner  as  rules  edit,  except  that  the  editing  is with 
  1228.  
  1229.          respect to asks rather than rules.
  1230.  
  1231.          
  1232.  
  1233.          The  prologue option starts the prologue editor subsystem and 
  1234.  
  1235.          displays  the  prologue  screen for the current file group in 
  1236.  
  1237.          XXXPERT.   Prologue  edit  functions  similarly to rules edit 
  1238.  
  1239.          except  that  XXXPERT limits the prologue to 20 lines of text 
  1240.  
  1241.          and the editor enforces this limit.  
  1242.  
  1243.          
  1244.  
  1245.          The  intermis option starts the intermis editor subsystem and 
  1246.  
  1247.          displays  the  intermis  screen for the current file group in 
  1248.  
  1249.          XXXPERT.   Intermis  edit  functions  similarly to rules edit 
  1250.  
  1251.          except  that  XXXPERT limits the intermis to 20 lines of text 
  1252.  
  1253.          and the editor enforces this limit.  
  1254.  
  1255.          
  1256.  
  1257.          
  1258.  
  1259.          The  epilogue option starts the epilogue editor subsystem and 
  1260.  
  1261.          displays  the  first  epilogue screenful for the current file 
  1262.  
  1263.          group  in  XXXPERT.   Prologue  edit  functions  similarly to 
  1264.  
  1265.          rules edit.
  1266.  
  1267.          
  1268.  
  1269.          Quit returns you to the XXXPERT main menu.
  1270.  
  1271.          
  1272.  
  1273.          
  1274.  
  1275.          
  1276.  
  1277.          EDITOR POP-UP MENU
  1278.  
  1279.          
  1280.  
  1281.          In  sny  edit  session, the slash key may be used to invoke a 
  1282.  
  1283.          pop-up menu that contains the following options:
  1284.  
  1285.          
  1286.  
  1287.          Continue      Save     Zap     Quit
  1288.  
  1289.          
  1290.  
  1291.          Continue  removes  the  pop-up  menu  and  continues the edit 
  1292.  
  1293.          process.
  1294.  
  1295.          
  1296.  
  1297.          Save  allows  you  to save edited material (rules or asks) to 
  1298.  
  1299.          disk  under  a  filename of your choosing.  When specifying a 
  1300.  
  1301.          filename  do not include an extension.  XXXPERT will add a .R 
  1302.  
  1303.          extension   for  files  saved  during  a  rules  edit,  a  .A 
  1304.  
  1305.          extension  for files saved during an asks edit a .P extension 
  1306.  
  1307.          for  files  saved  during a prologue edit, a .N extension for 
  1308.  
  1309.          files  saved  during an intermis edit, and a .E extension for 
  1310.  
  1311.          files  saved  during an epilogue edit.  Files that you intend 
  1312.  
  1313.          to  use  together  as  a  file  group  (set  of rules-realted 
  1314.  
  1315.          information)  should  be  saved  under  the same name  (ie: I 
  1316.  
  1317.          have  created  all  the  CHEESE  consultation files under the 
  1318.  
  1319.          name  CHEESE,  allowing  XXXPERT  to  provide the extensions, 
  1320.  
  1321.          resulting   in   DOS  filenames  of  CHEESE.R,  CHEESE.A  and 
  1322.  
  1323.          CHEESE.K  for  the CHEESE rules, CHEESE asks, and CHEESE keep 
  1324.  
  1325.          respectively).   The role of .K files is explained later.  My 
  1326.  
  1327.          
  1328.  
  1329.          CHEESE   example  does  not  use  prologue,  intermission  or 
  1330.  
  1331.          epilogue. 
  1332.  
  1333.          
  1334.  
  1335.          Zap  clears  out  the  contents  of  the area currently being 
  1336.  
  1337.          edited.   Note  that  Zap  has  no  impact  on  disk files by 
  1338.  
  1339.          itself.   Only  the data inside XXXPERT is cleared unless you 
  1340.  
  1341.          subsequently do a Save.
  1342.  
  1343.          
  1344.  
  1345.          Quit  takes  you  back  to the Editfile menu, terminating the 
  1346.  
  1347.          current  edit  process.  The edit data is retained in XXXPERT 
  1348.  
  1349.          but  is  not  saved  to  disk unless you do a save before the 
  1350.  
  1351.          quit.
  1352.  
  1353.          
  1354.  
  1355.          
  1356.  
  1357.          
  1358.  
  1359.          CONSULT
  1360.  
  1361.          
  1362.  
  1363.          The  main  menu's Consult option uses the current set of asks 
  1364.  
  1365.          and  rules  in  XXXPERT to conduct a consultation with you on 
  1366.  
  1367.          the  basis  of the logic you defined in those rules and asks.  
  1368.  
  1369.          Based  on  your  answers  to  the  questions XXXPERT poses, a 
  1370.  
  1371.          recommendation  will  be  made  according  to  the  inference 
  1372.  
  1373.          rules.   You  must  press  the return key with each reply you 
  1374.  
  1375.          provide  to  XXXPERT's  questions.  You may correct any error 
  1376.  
  1377.          in  an answer prior to pressing return by using the backspace 
  1378.  
  1379.          key   or   the   left-arrow   key.   You  may  terminate  the 
  1380.  
  1381.          consultation at any prompt by pressing the escape key (ESC.)
  1382.  
  1383.          
  1384.  
  1385.          Please  remember that XXXPERT's conclusion and recommendation 
  1386.  
  1387.          will  be  based solely on the rules you provide.  The quality 
  1388.  
  1389.          of  the recommendation is therefore directly dependent on the 
  1390.  
  1391.          quality   of  inference  rules  you  develop.   Before  using 
  1392.  
  1393.          XXXPERT  or CONSULT to make any important decision you should 
  1394.  
  1395.          thoroughly  test  the expert system you have built to be sure 
  1396.  
  1397.          that XXXPERT and CONSULT give you the results you intend.
  1398.  
  1399.          
  1400.  
  1401.          
  1402.  
  1403.          
  1404.  
  1405.          KEEP
  1406.  
  1407.          
  1408.  
  1409.          The  keep  command  on  XXXPERT's  main  menu  may be used to 
  1410.  
  1411.          create  and  store (on disk) a compiled form of the currently 
  1412.  
  1413.          retrieved  set  of  rules.   This  compiled form may later be 
  1414.  
  1415.          used  by  the  CONSULT  program  (CONSULT.COM) to immediately 
  1416.  
  1417.          conduct  a  consultation  session with that set of rules (and 
  1418.  
  1419.          associated  files) without the need to see the XXXPERT banner 
  1420.  
  1421.          screen,   use   menus,   perform   getfiles,   and  wait  for 
  1422.  
  1423.          compilations.    This   greatly   aids  in  the  creation  of 
  1424.  
  1425.          applications    involving   multiple   rulesbases,   multiple 
  1426.  
  1427.          consultations  and/or  other software (besides XXXPERT).  See 
  1428.  
  1429.          the CONSULT PROGRAM section later in this manual.
  1430.  
  1431.          
  1432.  
  1433.          
  1434.  
  1435.          
  1436.  
  1437.          TRACE
  1438.  
  1439.          
  1440.  
  1441.          The  trace  command  is  available on the main menu to switch 
  1442.  
  1443.          trace  mode  on  and  off for XXXPERT.  Requesting trace will 
  1444.  
  1445.          turn  the  trace  mode  on  if it is currently off, and vice-
  1446.  
  1447.          versa.   Consultations that are run while trace is on will be 
  1448.  
  1449.          accompanied   by   a  trace-style  debugging  report  on  the 
  1450.  
  1451.          inference  rules being used by XXXPERT's reasoning process as 
  1452.  
  1453.          the  consultation  progresses.   This  allows you to test the 
  1454.  
  1455.          rules you develop in an easy and visible way.
  1456.  
  1457.          
  1458.  
  1459.          
  1460.  
  1461.          
  1462.  
  1463.          XREF
  1464.  
  1465.          
  1466.  
  1467.          The  XREF  command  on  XXXPERT's  main  menu  may be used to 
  1468.  
  1469.          display  an  analysis report on the currently reteived set of 
  1470.  
  1471.          rules.   This  report  consists  of three parts: the listing, 
  1472.  
  1473.          the cross reference and the warnings analysis.
  1474.  
  1475.          
  1476.  
  1477.          The  listing  shows  the  current  set  of rules in a stadard 
  1478.  
  1479.          format  labeled  with line numbers to aid in use of the cross 
  1480.  
  1481.          reference part of the report.
  1482.  
  1483.          
  1484.  
  1485.          The  cross  refernce  shows  each  identifier in the rulebase 
  1486.  
  1487.          along  with the line numbers for each rule line in which that 
  1488.  
  1489.          identifier is used.
  1490.  
  1491.          
  1492.  
  1493.          The  warnings  analysis  reports instances in the current set 
  1494.  
  1495.          of  rules  where  a  field value is created but never used or 
  1496.  
  1497.          vice-versa.   That  is,  a warning message will be issued for 
  1498.  
  1499.          each  field  value  that appears in a THEN but is not used in 
  1500.  
  1501.          any  IF  and  for  each field value that is used in an IF but 
  1502.  
  1503.          does  not appear in any THEN.  Certain instances of the above 
  1504.  
  1505.          are screened out, however as follows:
  1506.  
  1507.          
  1508.  
  1509.          
  1510.  
  1511.          1.  A  field  value  that appears in a THEN for the goal will 
  1512.  
  1513.          not  be  subject  to  warnings  (since goals are not normally 
  1514.  
  1515.          used in IFs.
  1516.  
  1517.          
  1518.  
  1519.          2.   A  field  value that appears in an IF will be subject to 
  1520.  
  1521.          warnings  only  if  the field identifier  appears in at least 
  1522.  
  1523.          one  THEN  (with  another  value).   (Field  identifiers that 
  1524.  
  1525.          never  appear  with  any  value in any THEN are assumed to be 
  1526.  
  1527.          included in an ASK.)
  1528.  
  1529.          
  1530.  
  1531.          
  1532.  
  1533.          
  1534.  
  1535.          OUTPUT
  1536.  
  1537.          
  1538.  
  1539.          The  output  option  on  XXXPERT's  main  menu may be used to 
  1540.  
  1541.          access  a  selection  screen  that controls whether TRACE and 
  1542.  
  1543.          XREF  output  are  directed  to the screen (by default) or to 
  1544.  
  1545.          the first parallel printer port (by option).
  1546.  
  1547.          
  1548.  
  1549.          
  1550.  
  1551.          
  1552.  
  1553.          CONSULT PROGRAM
  1554.  
  1555.          
  1556.  
  1557.          The  CONSULT  program  allows  you  to conduct a consultation 
  1558.  
  1559.          session  using a set of rules for which a KEEP has previously 
  1560.  
  1561.          been   executed  in  XXXPERT.   CONSULT  goes  directly  into 
  1562.  
  1563.          consultation   without   any   intervening   screens,  menus, 
  1564.  
  1565.          compilations or prompts.
  1566.  
  1567.          
  1568.  
  1569.          CONSULT  may  be  started  by  typing CONSULT followed by the 
  1570.  
  1571.          name  of  the  'kept' rules that are to be used.  The example 
  1572.  
  1573.          below  would  initiate a consultation for the CAR rules using 
  1574.  
  1575.          the 'kept' car rulesfile: CAR.K and the CAR asksfile: CAR.A:
  1576.  
  1577.          
  1578.  
  1579.          consult car
  1580.  
  1581.          
  1582.  
  1583.          This  type of command may be used at the DOS prompt or within 
  1584.  
  1585.          a BATCH file on your DOS system.
  1586.  
  1587.          
  1588.  
  1589.          
  1590.  
  1591.          
  1592.  
  1593.          EXTENDED INPUT/OUTPUT
  1594.  
  1595.          
  1596.  
  1597.          The   CONSULT   program   has   a   feature  called  extended 
  1598.  
  1599.          input/output  that greatly facilitates the linking of XXXPERT 
  1600.  
  1601.          rulebases  with  each  other  and with information from other 
  1602.  
  1603.          systems.   Extended  input/output  allows  data  to be passed 
  1604.  
  1605.          into  a  consultation session and it allows the conclusion of 
  1606.  
  1607.          a   consultation   session   to  be  passed  out  to  another 
  1608.  
  1609.          consultation  session or another system.  The two most likely 
  1610.  
  1611.          uses  for  this  feature  are:  1-  linking together multiple 
  1612.  
  1613.          related  expert  systems  that  would  be  too  large  to  be 
  1614.  
  1615.          integrated  into  a  single rulebase (either because of human 
  1616.  
  1617.          limitations  or  XXPERT  limitations)  and  2- linking expert 
  1618.  
  1619.          systems  consultations  in  with  other PC-based applications 
  1620.  
  1621.          and data.
  1622.  
  1623.          
  1624.  
  1625.          You  may  pass data values into a consultation for any of the 
  1626.  
  1627.          rule  fields  by  arranging for the desired values to be in a 
  1628.  
  1629.          file  when  CONSULT  is  started.  The file name should match 
  1630.  
  1631.          the  rule  file  name  except  that the extension must be: .I 
  1632.  
  1633.          instead  of:  .R.  Thus to run a consultation passing data in 
  1634.  
  1635.          to  be  used with the CAR rules you would create a file named 
  1636.  
  1637.          CAR.I  and  start  the  session by issuing CONSULT CAR at the 
  1638.  
  1639.          DOS prompt (or within a batch file).
  1640.  
  1641.          
  1642.  
  1643.          
  1644.  
  1645.          Within  the  .I  file  the data fields and corresponding data 
  1646.  
  1647.          values  should  alternate  lines  in  a manner similar to the 
  1648.  
  1649.          ASKs  files.   The  first line should contain the first field 
  1650.  
  1651.          of  interest,  the second line a value for that field, and so 
  1652.  
  1653.          on.    Thus to inform the CAR consultation that it should use 
  1654.  
  1655.          a  value  of  44 for TURNS you would create a CAR.I file that 
  1656.  
  1657.          looks like this:
  1658.  
  1659.          
  1660.  
  1661.          TURNS
  1662.  
  1663.          44
  1664.  
  1665.          
  1666.  
  1667.          Turns  is the field of interest and therefore is on the first 
  1668.  
  1669.          (or  any  odd-numbered line) and 44 is the value for TURNS so 
  1670.  
  1671.          it is on the line immediately after TURNS.
  1672.  
  1673.          
  1674.  
  1675.          At  the end of any CONSULT session a value will be determined 
  1676.  
  1677.          for  the  goal  (assuming  the  rulebase  contains sufficient 
  1678.  
  1679.          knowledge).   CONSULT  always  then creates a file (with a .O 
  1680.  
  1681.          extension  and  a  name  matching  the  rule  file name) that 
  1682.  
  1683.          contains  the goal field name on the first line and the value 
  1684.  
  1685.          for  the  conclusion  on  the  second line.  This data may be 
  1686.  
  1687.          used  by  other  systems  or  by  other  CONSULT  sessions if 
  1688.  
  1689.          desired.   Note  that  (not coincidentally) the .O file has a 
  1690.  
  1691.          format  consistent  with  .I  file requirements.  This allows 
  1692.  
  1693.          you  to rename a .O file to an appropriate .I name and use it 
  1694.  
  1695.          as  input  to  a  consultation session (the renaming could be 
  1696.  
  1697.          done  in a batch file, for example).  You can, therefore, use 
  1698.  
  1699.          
  1700.  
  1701.          these  files  and  the  DOS  batch  file  capability  to link 
  1702.  
  1703.          multiple   rulebases   through   multiple   consultations  in 
  1704.  
  1705.          combination  with  any other software of your choosing.  This 
  1706.  
  1707.          allows  you  to  build arbitrarily complex expert systems and 
  1708.  
  1709.          integrate  them with non-XXXPERT appplications using familiar 
  1710.  
  1711.          DOS facilities!
  1712.  
  1713.          
  1714.  
  1715.          A  DOS  batch  file  to  link  the  CAR rulebase with another 
  1716.  
  1717.          rulebase (CARFIX, for example) might look like this:
  1718.  
  1719.          
  1720.  
  1721.          ERASE CAR.O
  1722.  
  1723.          ERASE CARFIX.I
  1724.  
  1725.          CONSULT CAR
  1726.  
  1727.          RENAME CAR.O CARFIX.I
  1728.  
  1729.          CONSULT CARFIX
  1730.  
  1731.          
  1732.  
  1733.          Such  a  batch  file  would  run a CAR consultation, pass the 
  1734.  
  1735.          conclusion  to  CARFIX  and  run the CARFIX consultation with 
  1736.  
  1737.          the  conclusion  of  the  CAR  consultation  as  input  (that 
  1738.  
  1739.          otherwise  would  need  to  be obtained from the user with an 
  1740.  
  1741.          ASK.)   The  ERASE commands have been included to prevent the 
  1742.  
  1743.          possibility  of using files left over from preious runs.  The 
  1744.  
  1745.          .O  files  are not created if CONSULT finds that its rulebase 
  1746.  
  1747.          does   not   provide   sufficient   knowledge   to   make   a 
  1748.  
  1749.          recommendation,  so  the  use of ERASE may be key to insuring 
  1750.  
  1751.          the integrity of your overall batch job.
  1752.  
  1753.          
  1754.  
  1755.          
  1756.  
  1757.          With  the above batch file as written, the first consult will 
  1758.  
  1759.          report  its  results  to  the  screen as well as to the CAR.O 
  1760.  
  1761.          file.    It    may   not   always   be  desirable  to  report 
  1762.  
  1763.          intermediate  results  in a series of CONSULTs and if this is 
  1764.  
  1765.          the  case,  screen  output  may  be suppressed by including a 
  1766.  
  1767.          second  parameter  (X)  in the CONSULT command after the rule 
  1768.  
  1769.          file  name.   In  the  above  example the output from the CAR 
  1770.  
  1771.          consultation  could  have  been  suppressed  by rewriting the 
  1772.  
  1773.          CONSULT command in the following way:
  1774.  
  1775.          
  1776.  
  1777.          CONSULT CAR X
  1778.  
  1779.          
  1780.  
  1781.          Note  that  these  various  file  sharing techniques could be 
  1782.  
  1783.          used  to  share  data  with spreadsheets, databases, graphics 
  1784.  
  1785.          packages or any other PC application.
  1786.  
  1787.          
  1788.  
  1789.          
  1790.  
  1791.          MINICON
  1792.  
  1793.          
  1794.  
  1795.          MINICON  is  a  version  of  CONSULT  that requires much less 
  1796.  
  1797.          memory  (RAM)  to run but lacks the ability to perform any of 
  1798.  
  1799.          the  ASK  functions.   It  is  very  useful  if  you  want to 
  1800.  
  1801.          integrate   an   expert   system   facility   inside  another 
  1802.  
  1803.          application  without  taking  much  additional  memory (about 
  1804.  
  1805.          115k  or  so).   All  data  needed  by MINICON to perform the 
  1806.  
  1807.          consultation  must already be in a .I file since ASKs are not 
  1808.  
  1809.          available.   MINICON may be used by most any application that 
  1810.  
  1811.          has the ablility to run external programs.
  1812.  
  1813.